<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="css/style.css" />
    <script type="text/javascript" src="js/jquery2.js"></script>
    <script type="text/javascript" src="js/jquery2.sorted.js"></script>
    <script type="text/javascript" src="js/bootstrap.js"></script>
    <script type="text/javascript" src="js/ckform.js"></script>
    <script type="text/javascript" src="js/common.js"></script>
    <script type="text/javascript" src="../js/contextPath.js"></script>
    <style type="text/css">
        body {font-size: 20px;
            padding-bottom: 40px;
            background-color:#e9e7ef;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


    </style>
</head>
<body>
<table class="table table-bordered table-hover definewidth m10" id="userdocumentclassM">
    <tr>
	     <th>序号</th>
        <th>文档名称</th>
        <th>分类</th>       
        <th>完成情况</th>
    </tr>
    </thead>
    <tbody id="tbody-result">
    </tbody>
</table>
</body>
</html>
<script>
    var table=document.getElementById("tbody-result");
    var url = location.search; //获取url中"?"符后的字串
    var theRequest = new Object();
    if (url.indexOf("?") != -1) {
        var str = url.substr(1);
        strs = str.split("&");
        for(var i = 0; i < strs.length; i ++) {
            theRequest[strs[i].split("=")[0]]=decodeURI(strs[i].split("=")[1]);
        }
    }
    $.ajax({
        type:'GET',
        url:contextPath+"all/mydoc/"+theRequest.name,
        success:function (data) {
            console.log(data);
            var str="";
            for (var i=0;i<data.count;i++) {
                str += "<tr>" +
                    "<td>" + i + "</td>" +
                    "<td>" + data.list[i].course_name+"</td>"+
                    "<td>" + data.list[i].course_dir+ "</td>" +
                    "<td>" + data.list[i].doc_jd + "</td>" +
                    "</tr>";
            }
            table.innerHTML=str;
        },
        error:function () {
            alert("查看失败");
        }
    })
</script>
